//首页
const express = require('express')
//引入连接池
const pool = require('../pool')
const router = express.Router()

router.get('/Recommended_today/', (req, res, next) => {
    var obj = req.query
    pool.query('select * from Recommended_today', [obj.aid], (err, r) => {
        if (err) {
            return next(err)
        }
        res.send({ code: 200, msg: '查询成功', data: r })
    })
})
router.get('/qy_mall/', (req, res, next) => {
    var obj = req.query
    pool.query('select * from qy_mall', [obj.mid], (err, r) => {
        if (err) {
            return next(err)
        }
        res.send({ code: 200, msg: '查询成功', data: r })
    })
})
router.get('/pop_notes/', (req, res, next) => {
    var obj = req.query
    pool.query('select * from pop_notes', [obj.nid], (err, r) => {
        if (err) {
            return next(err)
        }
        res.send({ code: 200, msg: '查询成功', data: r })
    })
})
router.get('/biu/', (req, res, next) => {
    var obj = req.query
    pool.query('select * from biu', [obj.nid], (err, r) => {
        if (err) {
            return next(err)
        }
        res.send({ code: 200, msg: '查询成功', data: r })
    })
})
module.exports = router